<?php
include_once 'library/Bootstrap/ApplicationBootstrap.php';
class BootstrapImpl extends ApplicationBootstrap implements Bootstrap{

	public function _init(){
		session_start();
		foreach (ApplicationConfig::getInstance()->getConfig(Configuration::MODULE) as $value) {
			$pattern = '/\/'.$value.'/';
			$route = new Route(
						Configuration::MODULE . "-fix-" . $value, 
						$pattern, 
						array(Configuration::MODULE => $value,'url'=>'$1')
			);
			$this->addRoute($route);
			
			$pattern = '/\/'.$value.'\/(.*)/';
			$route = new Route(
						Configuration::MODULE . "-" . $value, 
						$pattern, 
						array(Configuration::MODULE => $value,'url'=>'$1')
			);
			$this->addRoute($route);
		}
	}
}